﻿using System.Windows;
using System.Windows.Media;
using Com.Lancetinc.Evs.Controls;

namespace Com.Lancetinc.Evs
{
    public static class NeoControlHelper
    {
        #region OffsetX
        public static readonly DependencyProperty OffsetXProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.OffsetX),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(0.0));

        public static double GetOffsetX(UIElement element)
        {
            return (double)element.GetValue(OffsetXProperty);
        }

        public static void SetOffsetX(UIElement element, double value)
        {
            element.SetValue(OffsetXProperty, value);
        }

        #endregion

        #region OffsetY
        public static readonly DependencyProperty OffsetYProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.OffsetY),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(0.0));

        public static double GetOffsetY(UIElement element)
        {
            return (double)element.GetValue(OffsetYProperty);
        }

        public static void SetOffsetY(UIElement element, double value)
        {
            element.SetValue(OffsetYProperty, value);
        }

        #endregion

        #region BlurRadius
        public static readonly DependencyProperty BlurRadiusProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.BlurRadius),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(5.0));

        public static double GetBlurRadius(UIElement element)
        {
            return (double)element.GetValue(BlurRadiusProperty);
        }

        public static void SetBlurRadius(UIElement element, double value)
        {
            element.SetValue(BlurRadiusProperty, value);
        }

        #endregion

        #region SpreadRadius
        public static readonly DependencyProperty SpreadRadiusProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.SpreadRadius),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(2.0));

        public static double GetSpreadRadius(UIElement element)
        {
            return (double)element.GetValue(SpreadRadiusProperty);
        }

        public static void SetSpreadRadius(UIElement element, double value)
        {
            element.SetValue(SpreadRadiusProperty, value);
        }

        #endregion

        #region BorderRadius
        public static readonly DependencyProperty BorderRadiusProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.BorderRadius),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(0.0));

        public static double GetBorderRadius(UIElement element)
        {
            return (double)element.GetValue(BorderRadiusProperty);
        }

        public static void SetBorderRadius(UIElement element, double value)
        {
            element.SetValue(BorderRadiusProperty, value);
        }

        #endregion

        #region PrimaryColor
        public static readonly DependencyProperty PrimaryColorProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.PrimaryColor),
                typeof(Color),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(Colors.Silver));

        public static Color GetPrimaryColor(UIElement element)
        {
            return (Color)element.GetValue(PrimaryColorProperty);
        }

        public static void SetPrimaryColor(UIElement element, Color value)
        {
            element.SetValue(PrimaryColorProperty, value);
        }

        #endregion

        #region SecondaryColor
        public static readonly DependencyProperty SecondaryColorProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.SecondaryColor),
                typeof(Color),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(Colors.WhiteSmoke));

        public static Color GetSecondaryColor(UIElement element)
        {
            return (Color)element.GetValue(SecondaryColorProperty);
        }

        public static void SetSecondaryColor(UIElement element, Color value)
        {
            element.SetValue(SecondaryColorProperty, value);
        }

        #endregion

        #region Inset
        public static readonly DependencyProperty InsetProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.Inset),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(0.0));

        public static double GetInset(UIElement element)
        {
            return (double)element.GetValue(InsetProperty);
        }

        public static void SetInset(UIElement element, double value)
        {
            element.SetValue(InsetProperty, value);
        }

        #endregion

        #region RenderingMode
        public static readonly DependencyProperty RenderingModeProperty
            = DependencyProperty.RegisterAttached(
                nameof(NeoShader.RenderingMode),
                typeof(double),
                typeof(NeoControlHelper),
                new UIPropertyMetadata(0.0));

        public static double GetRenderingMode(UIElement element)
        {
            return (double)element.GetValue(RenderingModeProperty);
        }

        public static void SetRenderingMode(UIElement element, double value)
        {
            element.SetValue(RenderingModeProperty, value);
        }

        #endregion
    }
}